[rk3288][Android7.1]系统重启后speaker杂音问题

问题描述

  • 通过adb重启设备会出现杂音,全频段的杂音
  • 正常重启也会出现
  • 系统启动后如果播放任意一段音频后杂音消失
  • 系统关机后重新开机或者pmic reset后开机均没有此现象

问题分析

  • 首先怀疑codec的配置问题,由于android7.1属于系统升级,在android5.1中没有这个现象,对比kernel中的配置完全一样
  • 通过示波器测量codec i2c 控制信号,以及i2s的数据信号,确定speaker的信号源就是来自i2s
  • 进一步对比两套代码在i2s的配置发现,android5.1中在codec suspend时会将i2s的gpio配置为普通gpio

解决方法

至此找到问题的root cause,解决方法就是在suspend时将i2s配置为普通gpio。

patch

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/kernel/arch/arm/boot/dts/rk3288-xxx.dtsi b/kernel/arch/arm/boot/dts/rk3288-xxx.dtsi
index 748a4ba..2c6cfc6 100644 (file)
--- a/kernel/arch/arm/boot/dts/rk3288-xxx.dtsi
+++ b/kernel/arch/arm/boot/dts/rk3288-xxx.dtsi
@@ -290,8 +290,9 @@
reg = <0x10>;
clocks = <&cru SCLK_I2S0_OUT>;
clock-names = "mclk";
- pinctrl-names = "default";
+ pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2s0_mclk>;
+ pinctrl-1 = <&i2s0_mclk_sleep>;
#sound-dai-cells = <0>;
};
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/kernel/arch/arm/boot/dts/rk3288.dtsi b/kernel/arch/arm/boot/dts/rk3288.dtsi
index d370d67..888bc43 100644 (file)
--- a/kernel/arch/arm/boot/dts/rk3288.dtsi
+++ b/kernel/arch/arm/boot/dts/rk3288.dtsi
@@ -1173,8 +1173,9 @@
clocks = <&cru HCLK_I2S0>, <&cru SCLK_I2S0>;
assigned-clocks = <&cru SCLK_I2S_SRC>;
assigned-clock-parents = <&cru PLL_GPLL>;
- pinctrl-names = "default";
+ pinctrl-names = "default", "sleep";
pinctrl-0 = <&i2s0_bus>;
+ pinctrl-1 = <&i2s_gpio>;
rockchip,playback-channels = <8>;
rockchip,capture-channels = <2>;
status = "disabled";
@@ -2057,6 +2058,19 @@
i2s0_mclk: i2s0-mclk {
rockchip,pins = <6 8 RK_FUNC_1 &pcfg_pull_none>;
};
+
+ i2s0_mclk_sleep: i2s0-mclk-sleep {
+ rockchip,pins = <6 8 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
+ i2s_gpio: i2s-gpio {
+ rockchip,pins = <6 0 RK_FUNC_GPIO &pcfg_pull_none>,
+ <6 1 RK_FUNC_GPIO &pcfg_pull_none>,
+ <6 2 RK_FUNC_GPIO &pcfg_pull_none>,
+ <6 3 RK_FUNC_GPIO &pcfg_pull_none>,
+ <6 4 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+
};

lcdc {



您的支持将鼓励我继续创作!